<?php
$module = isset($_GET['m'])?$_GET['m']:'home';
$controller = isset($_GET['c'])?$_GET['c']:'Match';
$action = isset($_GET['a'])?$_GET['a']:'match';

define("MODULE",$module);
define("CONTROLLER",$controller);
define("ACTION",$action);

$controllername = CONTROLLER.'Controller';
$actionname = ACTION.'Action';

spl_autoload_register('myload');
$classlist = array(
	'F'=>'./framework/F.class.php',
	'Model'=>'./framework/Model.class.php',
	'Controller'=>'./framework/Controller.class.php',
	'MysqlDb'=>'./framework/MysqlDb.class.php',
	'Smarty'=>'./framework/smarty-3.1.30/libs/Smarty.class.php',
);
function myload($class){
	GLOBAL$classlist;
	if(isset($classlist[$class])){
		require $classlist[$class];
	}elseif (substr($class,-10)=='Controller') {
		require('./app/'.MODULE.'/controller/'.$class.'.class.php');
	}elseif (substr($class,-5)=='Model') {
		require('./app/'.MODULE.'/model/'.$class.'.class.php');
	}
}
$match = new $controllername();
$match->$actionname();